<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@page import="test.*"%>

<%@page import="java.sql.*"%>

<%@page import="java.util.*"%>

<%@page import="java.util.Date"%>
<%@page import="java.text.DateFormat"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type = "text/javascript" src = "workshop.js"></script>
<link rel="stylesheet" type="text/css" href="main.css"></link>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Admin Workshop</title>
</head>
<body>

<div id="header">
<div style="float: left"><img height="75px" width="165px"
	alt="IMAGE" src="./Img/banner1.jpg" /> <img height="75px" width="165px"
	alt="IMAGE" src="./Img/banner2.jpg" /> <img height="75px" width="165px"
	alt="IMAGE" src="./Img/banner3.jpg" /> <img height="75px" width="160px"
	alt="IMAGE" src="./Img/banner5.jpg" /> <img height="75px" width="160px"
	alt="IMAGE" src="./Img/banner4.jpg" /> <img height="75px" width="162px"
	alt="IMAGE" src="./Img/banner7.jpg" /></div>

</div>
<div id="main">
<div id="main-left">
<div id = "links">
<a id = "link1" href ="Home.jsp"> Home </a>
 <br/>
 <br/>
 <a id = "link2" href = "viewConferences.jsp"> View Conference</a>
  <br/>
 <br/>
 <a id = "link3" href = "RegisterConference.jsp"> Register for Conference</a>
  <br/>
 <br/>
 <a id = "link4" href = "ListOfAttendees.jsp"> List of Attendees</a>
  <br/>
 <br/>
 <a id = "link5" href = "PresentWorkshop.jsp">Submit Proposal</a>
  <br/>
 <br/>
 <a id = "link6" href = "Admin.jsp">Administrator</a>
 </div>
</div>
<div id="main-right">
<h1 id="title"><em>Tutor/Mentor Leadership And Networking
Conference</em></h1>
<div class="myProfile">
<%
String startD = null;
String endD = null;
//int cId = 0;
int confId=0;
int conferenceId = 0;
DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
	String confName = request.getParameter("conference");
if(confName == null || confName.equals(""))
{
	confName = (String)session.getAttribute("confName");
	startD = (String)session.getAttribute("startDate");
	endD   = (String)session.getAttribute("endDate");
	confId = (Integer)session.getAttribute("confId");
}
else
{
	 startD = request.getParameter("startDate");
	 endD = request.getParameter("endDate");
}
	
	Date startDate = df.parse(startD);
	Date endDate = df.parse(endD);
	try {
		ConferenceDataAccess confdata = new ConferenceDataAccess();
		java.sql.Date sqlStartDate = new java.sql.Date(startDate
				.getTime());
		java.sql.Date sqlEndDate = new java.sql.Date(endDate.getTime());
		session.setAttribute("confName",confName);
		session.setAttribute("startDate",startD);
		session.setAttribute("endDate",endD);
		if(confId==0)
		{
			
		 conferenceId = confdata.addNewConference(confName, sqlStartDate,
				sqlEndDate);
		
		}
		else
		{
			conferenceId = confId;
		}
		session.setAttribute("confId",conferenceId);
		
		
		 
		if (conferenceId>= 1)
%><h4>The <%=confName%> Conference has been successfully added</h4>
<%
	{

		}
%>
<%
	} catch (Exception e) {
		e.printStackTrace();
	
	}
%>
<h4>To add Workshops to be presented in this conference click here:<input
	type="button" id="addWorkshop" value="Add Workshops"/></h4>

<form id="addWorkshopDetails"  name = "workshop_form" action="AdminWorkshopSave.jsp" style="visibility:hidden"  method="post">

Workshop Name: <input type="text" name="wTitle" id=txtConference style="width: 275px"/>
<br />
<br />
Workshop Description:
<p><textarea rows="5" cols="55" name = "wdescr"></textarea></p>

<%
	try {
		WorkshopDataAccess1 workshopData = new WorkshopDataAccess1();
		Workshop w = new Workshop();
		List<Workshop> l1 = new ArrayList<Workshop>();
		
		l1 = workshopData.getAvailableTimeSlots(conferenceId);
		Iterator<Workshop> i = l1.iterator();
		String previousDay = "";
		String currDay = null;
		while (i.hasNext()) {
			w = i.next();
			String day1 = w.getHeldOn();
			String startTime = w.getStartTime();
			String endTime = w.getEndTime();
			currDay = day1;
			
			//if (currDay.equalsIgnoreCase(previousDay )) {
					
				%> <input type="radio" name = "timeSlots" value="<%=startTime%>-<%=endTime%>+<%=day1%>" /> <%=startTime%> - <%=endTime%> : <%=currDay%> <br/>
				<br/>
				
				<%
			//} 
			
			//previousDay = currDay;
		}
	} catch (Exception e) {
		e.printStackTrace();
	}
%>

<h4>What level of experience does this presentation address:
<select name="Session_experience_level"> 
  <option value="Beginner">Beginner</option> 
  <option value="Advanced">Advanced</option> 
  <option value="Both">Both</option> 
  </select> 
</h4>
<h4> Enter the email id of the main speaker for the workshop:</h4>
<h6>Note: A workshop may be presented by a number of speakers but each workshop will have one main speaker.
</h6>
Email: <input type = "text" id = "txtEmail" name = "Email" style="width: 275px"/>
  <br/>  
  <br/>
  <input type = "hidden" id = "stime"  name = "startTime"/>
  <input type = "hidden" id = "etime"  name = "endTime"/>
  <input type = "hidden" name = "dateOfWorkshop"  id = "date" />
  <input type ="submit" id = "btnSubmit" value = "Submit" onclick="get_radio_value()"/>
<input type="reset" id = "btnReset" value = "Reset"/>
</form>
</div>
</div>
</div>
</body>
</html>